package org.hawk.gwt.ppc.parser;

import org.hawk.gwt.ppc.utils.PreprocessorException;

/**
 * Exception is raised when parse error occurs.
 * @author alex.bereznevatiy@gmail.com
 *
 */
public class PreprocessorParseException extends PreprocessorException {
	private static final long serialVersionUID = -4182615321858212264L;

	public PreprocessorParseException(Token token) {
		this("Parse error", token); 
	}

	public PreprocessorParseException(String message, Token token) {
		this(message, token.getLine(), token.getOffset());
	}
	
	public PreprocessorParseException(String message, int line, int offset) {
		super((message == null ? "Parse error: " : message) + 
				" At line " + line + " offset " + offset);
	}
}
